import {
	request
} from '@/assets/api/index.js'

const sendArticleMsgApi = (data) => request("POST", '/memories/commonChecklist', data)
const getArticleMsgApi = (articleId, pageNum = 1) => request("GET", '/memories/commonChecklist/list?pageNum=' +
	pageNum +
	'&articleId=' + articleId +
	'&ccType=文章')

const memorialHallApi = (id) => request("GET", `/memories/meMemorial/app/${id}`)
const relationApi = (data) => request("POST", '/memories/relation', data)
const sendMsgApi = (data) => request("POST", '/memories/commonChecklist', data)
const getMsgApi = (meMemorialId, pageNum = 1) => request("GET", '/memories/commonChecklist/list?pageNum=' + pageNum +
	'&meMemorialId=' + meMemorialId +
	'&ccType=留言')
const getOfferingListApi = (meMemorialId, olType, olName, pageNum = 1, pageSize = 10, isOlTime = false) => request(
	"GET",
	`/memories/offeringList/list?meMemorialId=${meMemorialId}&olType=${olType}&olName=${olName}&pageNum=${pageNum}&pageSize=${pageSize}&isOlTime=${isOlTime}`
)
const getOfferingListUserApi = (meMemorialId, olType, olName, pageNum = 1, pageSize = 10, isOlTime = false) => request(
	"GET",
	`/memories/offeringList/listUser?meMemorialId=${meMemorialId}&olType=${olType}&olName=${olName}&pageNum=${pageNum}&pageSize=${pageSize}&isOlTime=${isOlTime}`
)
const offeringsTypeApi = () => request("GET", "/memories/offeringsType/list?pageSize=999")
const offeringsContentApi = (offeringsTypeId) => request("GET",
	"/memories/offeringsContent/list?pageSize=999&offeringsTypeId=" +
	offeringsTypeId)
const addOfferingListApi = (data) => request("POST", "/memories/offeringList", data)
const getEverlastingLampApi = () => request("GET", "/memories/everlastingLamp/list")
const getCandlelightApi = () => request("GET", "/memories/candlelight/list")
const getFestivallistApi = () => request("GET", "/memories/festival/getFestivallist")

export {
	memorialHallApi,
	relationApi,
	sendMsgApi,
	getMsgApi,
	getOfferingListApi,
	getOfferingListUserApi,
	offeringsTypeApi,
	offeringsContentApi,
	addOfferingListApi,
	getEverlastingLampApi,
	getFestivallistApi,
	sendArticleMsgApi,
	getArticleMsgApi,
	getCandlelightApi,
}